# This makefile requires GNU make.
# What: A makefile macro function to 
# target1 target2 target3 : prerequisite1 prerequisite2  prerequisite3
#         command 1
#         command 2
# $< : The filename of the first prerequisite.
# $@ : The filename representing the target
# $< : The filename of the first prerequsite.
# $? : The names of all prequisites that are newer than the target,
#      separated by spaces.
# $^ : The filnames of all the prerequisites,separted by spaces.
# $+ : Similar to $^, this i sthe names of all the prerequisites
#      separated by spaces.
# $* : The stem of the target filname. A stem is typically a filname
#      without its suffix.

INKSCAPE=/usr/bin/inkscape
PDFCROP=/usr/bin/pdfcrop

pdfs := $(patsubst %.svg,%.pdf,$(wildcard *.svg))


%.pdf: %.svg
	inkscape --export-pdf=$@ $<
	pdfcrop $@ output.pdf && mv output.pdf $@

all:	${pdfs}

clean:  
	rm -f *.pdf *~ *.log
